package cn.iocoder.yudao.module.policy.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.policy.entity.BannerDO;
import cn.iocoder.yudao.module.policy.vo.banner.BannerPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 轮播图 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface BannerMapper extends BaseMapperX<BannerDO> {

    default PageResult<BannerDO> selectPage(BannerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BannerDO>().eqIfPresent(BannerDO::getTitle, reqVO.getTitle()).eqIfPresent(BannerDO::getImageUrl, reqVO.getImageUrl()).eqIfPresent(BannerDO::getLinkUrl, reqVO.getLinkUrl()).eqIfPresent(BannerDO::getSort, reqVO.getSort()).eqIfPresent(BannerDO::getStatus, reqVO.getStatus()).betweenIfPresent(BannerDO::getCreateTime, reqVO.getCreateTime()).eqIfPresent(BannerDO::getRemark, reqVO.getRemark()).orderByDesc(BannerDO::getId));
    }

}